// 精灵形状..............................................................................................................................................................................
function SpriteShape(sprite, x, y){
	this.sprite = sprite;
	this.x = x;
	this.y = y;

	sprite.left = x;
	sprite.top = y;
	
	this.setPolygonPoints();
}

SpriteShape.prototype = new Polygon();

SpriteShape.prototype.move = function(dx, dy){
	var point,
		x;

	for(var i = 0; i < this.points.length; i++){
		point = this.points[i];
		point.x += dx;
		point.y += dy;
	}

	this.sprite.left = this.points[0].x;
	this.sprite.top = this.points[0].y;
};

SpriteShape.prototype.fill = function(context){
	// Nothing to do.
};

SpriteShape.prototype.setPolygonPoints = function(){
	this.points.push(new Point(this.x, this.y));
	this.points.push(new Point(this.x + this.sprite.width, this.y));
	this.points.push(new Point(this.x + this.sprite.width, this.y + this.sprite.height));
	this.points.push(new Point(this.x, this.y + this.sprite.height));
};

SpriteShape.prototype.stroke = function(context){
	this.sprite.paint(context);
};